<?php


 function generateNewSchoolXml(){
 
 
    $xdoc = new DomDocument;
    $xdoc->Load('../gallerydata.xml');
	
	$newPicture = $xdoc->createElement('picture');
	
	$title = $xdoc->createElement( "title" );
	$title->appendChild(
		$xdoc->createTextNode($title_input)
	);
	
	$description = $xdoc->createElement( "desctiption" );
	$description->appendChild(
		$xdoc->createTextNode($description_input)
	);
	
	$url = $xdoc->createElement( "url" );
	$url->appendChild(
		$xdoc->createTextNode($url_input)
	);

	$newPicture->appendChild( $title );
	$newPicture->appendChild( $description );
	$newPicture->appendChild( $url );
	$xdoc->getElementsByTagName('pictures')->item(0)->appendChild( $newPicture );

    $xdoc->save("../gallerydata.xml");
	
	echo "writing the xml succefull!";
}




?>